package com.article.service.impl;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.article.dao.ICategoryDAO;
import com.article.entity.Category;
import com.article.service.ICategoryService;

@SuppressWarnings("unchecked")
@Transactional
public class CategoryServiceImpl implements ICategoryService {
	private ICategoryDAO categoryDAOImpl;

	public boolean addCategory(Category category) {
		try{
			categoryDAOImpl.insert(category);
			return true;
		}catch(Exception e){
			return false;
		}
	}
	
	public List<Category> findAll() {
		return categoryDAOImpl.findAll();
	}

	public void setCategoryDAOImpl(ICategoryDAO categoryDAOImpl) {
		this.categoryDAOImpl = categoryDAOImpl;
	}

}
